/**
*      author: Y_Yao
*      created: 2025-04-06 16:27:08
**/

#include<bits/stdc++.h>

#define int LL
using namespace std;
using LL = long long;
const LL LLINF = 9e18;
const int INF = 0x3f3f3f3f;
const int N = 2e5 + 7;
int n;
int a[N];

void solve()
{
    cin >> n;
    vector<int> odd;
    vector<int> even;
    int mxj = -INF;
    int mxo = -INF;
    for(int i = 1;i <= n;i++)
    {
        cin >> a[i];
        if(a[i] % 2 == 0)//偶数
        {
            mxo = max(mxo,a[i]);
            even.push_back(a[i]);
        }
        else
        {
            mxj = max(mxj,a[i]);
            odd.push_back(a[i]);
        }
    }
    // cout << mxo << " " << mxj << endl;
    if(mxj == -INF)
    {
        cout << mxo << endl;
        return;
    }
    if(mxo == -INF)
    {
        cout << mxj << endl;
        return;
    }
    int t1 = mxo,t2 = mxj;
    bool flag = false;
    for(auto& e : odd)
    {
        if(e == t2 && flag == false)
        {
            flag = true;
            continue;
        }
        int y = e / 2;
        mxo += y * 2;
    }
    flag = false;
    for(auto& e : even)
    {
        if(e == t1 && flag == false)
        {
            flag = true;
            continue;
        }
        int y = e / 2;
        mxj += y * 2;
    }
    cout << mxj + mxo << endl;

}

signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);

    int t = 1;
    cin >> t;
    while(t--)
    {
        solve();
    }
    return 0;
}